#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <locale.h>

int main(int argc, char * argv[])
{
	
	char mass1[20], mass2[20];
	int a=0;
	FILE* file_1;
	FILE* file_2;
	setlocale(LC_ALL, "russian");
	if(argc>3)
	{
		printf("Enter required number of arguments!");
		break;
	}

	if((file_1=fopen(argv[1],"r"))==NULL)
	{
		printf("Error!");
		return 1;
	}
	if((file_2=fopen(argv[2],"r"))==NULL)
	{
		printf("Error!");
		fclose(file_1);
		return 2;
	}
	
	while((!feof(file_1))&&(!feof(file_2)))
	{
		fgets(mass1, 20, file_1);
		fgets(mass2, 20, file_2);
		a++;
		if(strcmp(mass1,mass2))
		{
			
			printf("%d\n",a);
			break;
		}
    }
	
	fclose(file_1);
	fclose(file_2);
    system("pause");

    
	return 0;
}